From: Steven Hand Date: Thu, 4 Jan 2007 10:58:01 +0000 (+0000) Subject: Make sure we always have a sensible idle function; this fixes problems X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15422^2~94 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=1033df914402ac2cdf6db55cc9f79c9888adabe4;p=xen.git Make sure we always have a sensible idle function; this fixes problems booting dom0 on AMD introduced by -unstable cset 13213:bf25488db8eb. Signed-off-by: Steven Hand --- diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c index 00a8d8a8eb..0dbc6a412e 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c @@ -168,17 +168,22 @@ void cpu_idle(void) /* endless idle loop with no priority at all */ while (1) { while (!need_resched()) { + void (*idle)(void); if (__get_cpu_var(cpu_idle_state)) __get_cpu_var(cpu_idle_state) = 0; rmb(); + idle = pm_idle; + + if (!idle) + idle = xen_idle; if (cpu_is_offline(cpu)) play_dead(); __get_cpu_var(irq_stat).idle_timestamp = jiffies; - pm_idle(); + idle(); } preempt_enable_no_resched(); schedule(); @@ -216,8 +221,6 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait); void __devinit select_idle_routine(const struct cpuinfo_x86 *c) { - if (!pm_idle) - pm_idle = xen_idle; } static int __init idle_setup (char *str) diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c index c12ebe0e01..8267a772b7 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c @@ -182,14 +182,18 @@ void cpu_idle (void) /* endless idle loop with no priority at all */ while (1) { while (!need_resched()) { + void (*idle)(void); + if (__get_cpu_var(cpu_idle_state)) __get_cpu_var(cpu_idle_state) = 0; rmb(); - + idle = pm_idle; + if (!idle) + idle = xen_idle; if (cpu_is_offline(smp_processor_id())) play_dead(); enter_idle(); - pm_idle(); + idle(); __exit_idle(); } @@ -230,8 +234,6 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait); void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) { - if (!pm_idle) - pm_idle = xen_idle; } static int __init idle_setup (char *str)